home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SYN.ZIP / W1.ASM < prev   
Assembly Source File  |  1994-04-21  |  5KB  |  215 lines

  1.  
  2. oldstring db '                      '
  3.              ;1234567890123456789012
  4. newstring db '                      '
  5.           db '    INSANE CREATORS   '
  6.           db '      ENTERPRISES     '
  7.           db '       PRESENTS       '
  8.           db ' THIS LITTLE DOT DEAL '
  9.           db '     BY FRIAR TUCK    '
  10.           db '  ALL LETTER MUST BE  '
  11.           db ' IN CAPS AND THE ONLY '
  12.           db '  PUNCTUATION IS .?!  '
  13.           db '  OH YEAH, AND SPACE  '
  14. numstrings = 9
  15.  
  16. curr_flip db 22 dup(10)
  17.  
  18. linedone db 1
  19.  
  20. char_loc label word
  21.         ct=3228
  22.         REPT 22
  23.           dw ct
  24.           ct=ct+FONT_XSIZE
  25.         ENDM
  26.  
  27. include font.asm
  28. include flip.dat
  29.  
  30. @plotpoint macro
  31.         push cx
  32.         push di
  33.         mov bx,ax
  34.         mov cx,di
  35.         and cx,3
  36.         shr di,2
  37.         mov ah,1
  38.         shl ah,cl
  39.         mov al,02
  40.         mov dx,03C4h
  41.         out dx,ax
  42.         mov byte ptr es:[di],bl
  43.         add di,80
  44.         mov byte ptr es:[di],bl
  45.         pop di
  46.         pop cx
  47. endm @plotpoint
  48.  
  49. nochar  db      0
  50.         ; DI = x/y location
  51.         ; AX = char
  52.         ; BX = flipline # (0-5)
  53. Write_char proc
  54.         pusha
  55.         mov cs:[nochar],0
  56.         cmp al,'!'
  57.         je wc00
  58.         cmp al,' '
  59.         je wc01
  60.         cmp al,'?'
  61.         je wc00a
  62.         cmp al,'.'
  63.         je wc00b
  64.         cmp ax,65
  65.         jl wc_exit
  66.         cmp ax,90
  67.         jg wc_exit
  68.         sub ax,65
  69.         jmp short wc02
  70. wc00a:  mov ax,28
  71.         jmp short wc02
  72. wc00b:  mov ax,29
  73.         jmp short wc02
  74. wc00:   mov ax,26
  75.         jmp short wc02
  76. wc01:   mov ax,27
  77. wc02:   mov cx,F_TOTALBYTES
  78.         imul cx
  79.         mov dx,ax
  80.         add dx,offset FONT_A
  81.         sal bx,5
  82.         ;bx=proper flipline,dx=offset of font char
  83.         mov cx,30
  84. wc03:   push cx
  85.         push di
  86.         ;-----
  87.         movzx ax,byte ptr cs:flipline[bx]
  88.         mov cx,ax
  89.         sal ax,3
  90.         sal cx,2
  91.         add ax,cx
  92.         mov si,dx
  93.         add si,ax
  94.         push dx
  95.         push bx
  96.         mov cx,12
  97. wc04:   mov al,byte ptr cs:[si]
  98.         add al,80h
  99.         @plotpoint              ; plots al to es:[di]
  100.         inc si
  101.         inc di
  102.         loop wc04
  103.         pop bx
  104.         pop dx
  105.         inc bx
  106.         pop di
  107.         add di,640
  108.         pop cx
  109.         dec cx
  110.         jnz wc03
  111. wc_exit:
  112.         popa
  113.         ret
  114. Write_char endp
  115.  
  116. democount dd 0
  117. curr_char        dw      65
  118.  
  119. String_update proc
  120.         mov eax,[democount]
  121.         and ax,1
  122.         jnz string_done
  123.         mov cx,22
  124.         xor bx,bx
  125. su00:   push cx
  126.         push bx
  127.         mov al,byte ptr curr_flip[bx]
  128.         cmp al,11
  129.         je su_next;01a
  130.         cmp al,24
  131.         jl su01
  132.         mov al,byte ptr newstring[bx]
  133.         mov byte ptr oldstring[bx],al
  134.         mov byte ptr curr_flip[bx],0
  135.         jmp short su01a
  136. su01:
  137.         inc byte ptr curr_flip[bx]
  138. su01a:
  139.         movzx ax,byte ptr oldstring[bx]
  140.         movzx dx,byte ptr curr_flip[bx]
  141.         add bx,bx
  142.         mov di,word ptr char_loc[bx]
  143.         mov bx,dx
  144.         call Write_char
  145. su_next:
  146.         pop bx
  147.         inc bx
  148.         pop cx
  149.         loop su00
  150. string_done:
  151.         ret
  152. String_update endp
  153.  
  154. writercount dd 0
  155.  
  156. inc_string proc
  157.         mov eax,[writercount]
  158.         mov ebx,eax
  159.         and ebx,15
  160.         jnz is_done
  161.         sar eax,4
  162.         cmp eax,22
  163.         setge [linedone]
  164.         jge is_done
  165.         mov bx,ax
  166.         mov byte ptr curr_flip[bx],12
  167. is_done:
  168.         ret
  169. inc_string endp
  170.  
  171. strpointer dw offset newstring
  172.  
  173. setstrings proc
  174.         inc [writercount]
  175.         cmp [linedone],1
  176.         jne ss_exit
  177.         add [strpointer],22
  178.         mov si,[strpointer]
  179.         mov di,offset newstring
  180.         mov cx,11
  181. ss00:   mov ax,word ptr ds:[si]
  182.         mov word ptr ds:[di],ax
  183.         add si,2
  184.         add di,2
  185.         loop ss00
  186.         mov [linedone],0
  187.         mov [writercount],0
  188.         cmp [strpointer],offset newstring + 22*numstrings
  189.         jne ss_exit
  190.         mov [strpointer],offset newstring
  191. ss_exit:
  192.         ret
  193. setstrings endp
  194.  
  195. writer_init:
  196.         ;Write the Palette
  197.         mov dx,03C8h
  198.         mov al,80h
  199. ;        xor al,al
  200.         out dx,al
  201.         inc dx
  202.         mov si,offset font_pal
  203.         mov cx,9
  204.         rep outsb
  205.         ret
  206.  
  207. do_writing:
  208.         call setstrings
  209.         call inc_string
  210. ;        inc [democount]
  211.         ;
  212.         call String_update
  213.         ret
  214.  
  215.